home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 7 / Amiga Format AFCD07 (Dec 1996, Issue 91).iso / serious / shareware / programming / aros / exec / freevec.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-12  |  1.3 KB  |  68 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: freevec.c,v 1.4 1996/08/13 13:56:03 digulla Exp $
  4.     $Log: freevec.c,v $
  5.     Revision 1.4  1996/08/13 13:56:03  digulla
  6.     Replaced __AROS_LA by __AROS_LHA
  7.     Replaced some __AROS_LH*I by __AROS_LH*
  8.     Sorted and added includes
  9.  
  10.     Revision 1.3  1996/08/01 17:41:12  digulla
  11.     Added standard header for all files
  12.  
  13.     Desc:
  14.     Lang: english
  15. */
  16. #include "exec_intern.h"
  17. #include <aros/libcall.h>
  18. #include "machine.h"
  19. #include "memory.h"
  20.  
  21. /*****************************************************************************
  22.  
  23.     NAME */
  24.     #include <clib/exec_protos.h>
  25.  
  26.     __AROS_LH1(void, FreeVec,
  27.  
  28. /*  SYNOPSIS */
  29.     __AROS_LHA(APTR, memoryBlock, A1),
  30.  
  31. /*  LOCATION */
  32.     struct ExecBase *, SysBase, 115, Exec)
  33.  
  34. /*  FUNCTION
  35.     Free some memory allocated with allocvec.
  36.  
  37.     INPUTS
  38.     memoryBlock - The memory to be freed. It is safe to free a NULL pointer.
  39.  
  40.     RESULT
  41.  
  42.     NOTES
  43.  
  44.     EXAMPLE
  45.  
  46.     BUGS
  47.  
  48.     SEE ALSO
  49.     AllocVec()
  50.  
  51.     INTERNALS
  52.  
  53.     HISTORY
  54.     15-10-95    created by m. fleischer
  55.  
  56. ******************************************************************************/
  57. {
  58.     __AROS_FUNC_INIT
  59.  
  60.     /* If there's nothing to free do nothing. */
  61.     if(memoryBlock!=NULL)
  62.     {
  63.     *(UBYTE **)&memoryBlock-=ALLOCVEC_TOTAL;
  64.     FreeMem(memoryBlock,*(ULONG *)memoryBlock);
  65.     }
  66.     __AROS_FUNC_EXIT
  67. } /* FreeVec */
  68.